@model Sio.Cms.Lib.ViewModels.SioPages.ReadMvcViewModel
@{
    var listTags = Model.Articles.Items.Where(a => !string.IsNullOrEmpty(a.Article.Tags)).Select(a => a.Article.Tags).ToList();
    string tags = string.Empty;
    if (listTags.Count > 0)
    {
        for (int i = 0; i < listTags.Count; i++)
        {
            tags += listTags[i] + ",";
        }
    }
    string culture = ViewBag.culture;
}

<div class="blog-posts">
    <div class="page-header page-header-small">
        <div class="page-header-image" data-parallax="true" style="background-image: url('@Model.ImageUrl') ;">
        </div>
        <div class="content-center">
            <div class="row">
                <div class="col-md-8 ml-auto mr-auto text-center">
                    <h2 class="title">@Model.Title</h2>
                    <a href="#button" class="btn btn-primary btn-round  btn-icon">
                        <i class="fab fa-twitter"></i>
                    </a>
                    <a href="#button" class="btn btn-primary btn-round  btn-icon">
                        <i class="fab fa-instagram"></i>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="projects-4">
        <div class="container-fluid">
            
            @for(int i = 0; i< Model.Articles.TotalItems; i+=2)
            {
                var article = Model.Articles.Items[i].Article;
                var index = (i/2)%2;
                if(i < Model.Articles.TotalItems - 1)
                {
                    var nextArticle = Model.Articles.Items[i+1];
                    <div class="row">
                        @await Html.PartialAsync("../Pages/_List_Post_Item.cshtml"
                        , article
                        , new ViewDataDictionary(this.ViewData)
                        {
                            {
                                "Index", i
                            }
                        })
                        @await Html.PartialAsync("../Pages/_List_Post_Item.cshtml"
                        , nextArticle.Article
                        , new ViewDataDictionary(this.ViewData)
                        {
                            {
                                "Index", i+1
                            }
                        })
                    </div>
                }
                else{
                    <div class="row">
                        @await Html.PartialAsync("../Pages/_List_Post_Item.cshtml"
                        , article
                        , new ViewDataDictionary(this.ViewData)
                        {
                            {
                                "Index", i
                            }
                        })
                    </div>
                }
                
                
            }
            </div>
        </div>
    </div>
</div>
